<template>
  <div class="no-padding app-container check-bus-root">
    <div v-if="inspectInfo != null " class="process-container">
      <inspect-info ref="inspectInfo" :handel-code="handelCode" :inspect-info="inspectInfo"></inspect-info>

<!--      <sub-txt ref="subTxt"  :inspect-info="inspectInfo" :handel-code="handelCode"></sub-txt>-->
    </div>
    <div v-if="inspectInfo != null " class="table-data-container">
      <component   @change="reload" v-if="inspectInfo != null" :handelCode="handelCode"
                 :inspectInfo="inspectInfo" :is="`${handelCode}Info`"></component>
    </div>
  </div>
</template>

<script>
import {inspectMixins} from "@/views/checkBusPage/mixins/inspectMixins";
import SuperviseAndExamineInfo from "@/views/checkBusPage/subInfoPage/superviseAndExamineInfo.vue";
import SpotCheckInfo from "@/views/checkBusPage/subInfoPage/spotCheckInfo.vue";
import subTxt from '@/views/checkBusPage/components/subTxt'
import {HIDDEN_DANGER_INFO_PAGE_CONFIG} from "@/views/checkBusPage/subInfoPage/infoPageConfig";
import {questionStatistic} from "@/api/checkPage/quertion";
import inspectInfo from "@/views/checkBusPage/components/inspectInfo/index.vue";

export default {
  name: "check_sub_page_info",
  mixins: [inspectMixins],
  components: {
    SuperviseAndExamineInfo,
    SpotCheckInfo,
    subTxt,
    inspectInfo,
  },
  data() {
    return {
      danInfoData:null,
      dataId: ''
    }
  },
  methods: {
    reload() {
      let owner = this
      owner.$refs.inspectInfo.reload()

      // this.getInfoData().then(res => {
      //   owner.$refs.inspectInfo.reload()
      // })
    },
    getInfoData() {
      let owner = this
      return new Promise((resolve, reject) => {
        let configItem =  HIDDEN_DANGER_INFO_PAGE_CONFIG[this.handelCode]
        if (configItem == null || configItem == '') {
          resolve()
          return
        }
        questionStatistic(configItem.queryUrl,{id:this.dataId}).then(res =>{
          owner.danInfoData = res.data
          resolve()
        })
      })

    }
  },
  created() {
    // this.dataId = this.$route.query?.dataId != null && this.$route.query?.dataId !== '' ? this.$route.query.dataId : null;
    // this.getInfoData()
  }
}
</script>

<style scoped>

</style>
